﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using ESOL.Common.Schema;
using Suzsoft.Smart.EntityCore;
using System.Data;

namespace ESOL.Common.Entity
{
    [DataContract]
    [Serializable]
    public partial class ProdPpMtrlHoldEntity : EntityBase
    {
        public ProdPpMtrlHoldTable TableSchema
        {
            get
            {
                return ProdPpMtrlHoldTable.Current;
            }
        }

        public ProdPpMtrlHoldEntity()
        {

        }

        public ProdPpMtrlHoldEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.PpNo = Convert.ToString(CommonFunctions.ToObject(dr["PP_NO"]));
            this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_ID"]));
            this.MtrlName = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_NAME"]));
            this.MtrlCode = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_CODE"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public ProdPpMtrlHoldEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.PpNo = Convert.ToString(CommonFunctions.ToObject(dr["PP_NO"]));
            this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_ID"]));
            this.MtrlName = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_NAME"]));
            this.MtrlCode = Convert.ToString(CommonFunctions.ToObject(dr["MTRL_CODE"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdPpMtrlHoldTable.Current;
            }
        }

        #region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_ID)); }
            set { SetData(ProdPpMtrlHoldTable.C_ID, value); }
        }

        [DataMember]
        public string PpNo
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_PP_NO)); }
            set { SetData(ProdPpMtrlHoldTable.C_PP_NO, value); }
        }

        [DataMember]
        public string MtrlId
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_MTRL_ID)); }
            set { SetData(ProdPpMtrlHoldTable.C_MTRL_ID, value); }
        }

        [DataMember]
        public string MtrlName
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_MTRL_NAME)); }
            set { SetData(ProdPpMtrlHoldTable.C_MTRL_NAME, value); }
        }

        [DataMember]
        public string MtrlCode
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_MTRL_CODE)); }
            set { SetData(ProdPpMtrlHoldTable.C_MTRL_CODE, value); }
        }

        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(ProdPpMtrlHoldTable.C_QTY)); }
            set { SetData(ProdPpMtrlHoldTable.C_QTY, value); }
        }

        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_UNIT)); }
            set { SetData(ProdPpMtrlHoldTable.C_UNIT, value); }
        }

        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_REMARK)); }
            set { SetData(ProdPpMtrlHoldTable.C_REMARK, value); }
        }

        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(ProdPpMtrlHoldTable.C_STATUS)); }
            set { SetData(ProdPpMtrlHoldTable.C_STATUS, value); }
        }

        #endregion
    }
}
